home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1989 December
/
1989-12.d64
/
disk inventory
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
86 lines
10 rem copyright 1989 compute! publications, inc. - all rights reserved
20 poke53280,0:poke53281,0:print"[147][158]"
30 printtab(10)" "
40 printtab(10)" disk inventory "
50 printtab(10)" "
60 print" 1) inventory all files"
70 print" 2) inventory 'prg' files only"
80 print" 3) inventory 'seq' files only"
90 print" insert first disk and make selection"
100 geta$:ifa$=""then100
110 ifa$<"1"ora$>"3"then100
120 b$="$"
130 ifa$="2"thenb$="$:*=p"
140 ifa$="3"thenb$="$:*=s"
150 dimr$(500):current=0
160 open15,8,15:open1,8,0,b$
170 print"[147]":print" filename type disk name"
180 print"[195][195][195][195][195][195][195][195][195][195][195][195][195] [195][195][195][195] [195][195][195][195][195][195][195][195][195][195][195][195][195][158]"
190 get#1,d$,d$,d$,d$,d$,d$,d$,d$
200 dn$=""
210 fori=1to16:get#1,x$:dn$=dn$+x$:nexti
220 get#1,d$,d$,d$,d$,d$,d$,d$,d$
230 get#1,d$,d$,l$,d$,e$
240 ife$="b"then350
250 get#1,x$:ifx$<>chr$(34)then250
260 n$=""
270 get#1,x$:ifx$<>chr$(34)thenn$=n$+x$:goto270
280 get#1,d$:ifd$=" "then280
290 t$=d$:get#1,d$,d$
300 fori=len(n$)to16:n$=n$+chr$(32):nexti
310 r$(current)=n$+t$+chr$(32)+dn$
320 printr$(current):current=current+1
330 get#1,d$:ifd$=" "then330
340 goto230
350 print:print"insert next disk or press a key to stop"
360 q=16:gosub410:rem being removed?
370 q=0:gosub410:rem fully removed?
380 q=16:gosub410:rem being inserted?
390 q=0:gosub410:rem fully inserted?
400 close1:close15:goto160:rem read next disk
410 getw$:ifw$<>""then480
420 print#15,"m-r"chr$(30)chr$(0)
430 get#15,z$:ifz$=""thenz$=chr$(0)
440 ifasc(z$)=qthen410
450 return
460 print"[147] disk error: "en$;" "em$;" "et$;" "es$
470 close15:end
480 print"[147] select: [158]":print:print:print
490 print" 1) sort by filename":print
500 print" 2) save as an ascii file":print
510 print" 3) display to screen"
520 print" (use <ctrl> to slow listing)":print
530 print" 4) print list":print
540 print" 5) exit":print
550 getd$:ifd$=""then550
560 ifd$<"1"ord$>"5"then550
570 d=val(d$):on d goto660,750,590,810,580
580 close15:end
590 print"[147]":print" filename type disk name"
600 print"[195][195][195][195][195][195][195][195][195][195][195][195][195] [195][195][195][195] [195][195][195][195][195][195][195][195][195][195][195][195][195][158]"
610 for i=1tocurrent:printr$(i):nexti
620 print:print" end (press any key)"
630 getd$:ifd$=""then630
640 goto480
650 rem *** sort routine ***
660 print"[147][159]sorting..."
670 m=current-1
680 m=int(m/2):ifm=0then480
690 j=0:k=current-1-m
700 i=j
710 l=i+m
720 if r$(i)>r$(l)thent$=r$(i):r$(i)=r$(l):r$(l)=t$:i=i-m:ifi>0then710
730 j=j+1:ifj>kthen680
740 goto700
750 input"[147]filename ";n$:n$=left$(n$,16)
760 open2,8,8,"0:"+n$+",s,w"
770 print#2," filename type disk name"
780 print#2,"------------- ---- -------------"
790 for i=1tocurrent:print#2,r$(i):nexti
800 print#2:close2:goto480
810 open4,4:cmd4
820 print#4," filename type disk name"
830 print#4,"------------- ---- -------------"
840 for i=1tocurrent:print#4,r$(i):nexti
850 print#4:close4:goto480